package com.sun.mybatisplus.redis.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Auth: syh
 * @Date: 2021/11/18 8:32
 * @Email: 1014170249@qq.com
 * @Desc: 不在能知，而在能行
 * 用户点赞表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user_like")
public class UserLike {
    //主键id
    @TableId(type= IdType.AUTO)
    private Integer id;

    @TableField("liked_user_id")
    //被点赞的用户的id
    private String likedUserId;

    @TableField("liked_post_id")
    //点赞的用户的id
    private String likedPostId;

    @TableField("status")
    //点赞的状态.默认未点赞
    private Integer status = LikedStatusEnum.UNLIKE.getCode();

    public UserLike(String likedUserId, String likedPostId, Integer status) {
        this.likedUserId = likedUserId;
        this.likedPostId = likedPostId;
        this.status = status;
    }
}
